#include "process.h"

void Download(double total, double every)
{
    double cur_total = 0.0;
    double cur_total_size = 0.0;
    while(cur_total_size <= total)
    {
        FlushProcess(cur_total);
        if(cur_total_size >= total) break;
        usleep(50000);
        cur_total_size += every;
        if(cur_total_size > total)
        {
            cur_total_size = total;
        }
        cur_total = cur_total_size / total * 100;
    }
    printf("\n");
}

int main()
{
    //Process();
    Download(1024.0, 10.4);
    return 0;
}
